Remove the file-upload workspace feature; keep namespace discovery - #14
Merged
Conversation
The namespace file-workspace was a generic base64 blob store (upload/list/ delete files under a server root) — a redundant ingestion path next to local `ccg build` and webhook clone/pull, and off the project's purpose (annotation + graph + search for code context). Drop it, but keep namespace *discovery*. - delete internal/namespacefs (~500 LOC: upload/list/delete/write machinery) - remove 5 MCP tools: upload_file, upload_files, list_files, delete_file, delete_namespace (24 -> ... net 21 with the reworked tool below) - rework list_namespaces to be graph-backed: distinct namespaces with per-namespace node counts, paginated, cross-namespace; registered under the query tool group so callers can scope searches to other namespaces - relocate the namespace path-safety helpers into internal/mcp/namespace_paths.go (used by RAG doc reads), rewired onto pathutil.ValidateNamespacePath + safepath.EnsureNoSymlinkInPath; validation logic is unchanged - move the namespace-name/path validator to internal/pathutil; wikiserver uses it - sweep docs, skills, AGENTS.md, and the integration script (drop the file-upload phases; the MCP build phase relied on upload and is covered by the webhook clone->build pipeline) Path-traversal and symlink-escape checks are preserved verbatim (independently reviewed). Net -2235 lines. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Removes the namespace file-upload workspace — a generic base64 blob store (upload/list/delete files under a server root). It was a redundant ingestion path next to local
ccg buildand the webhook clone/pull pipeline, and off the project's purpose (annotation + graph + search for code context). Namespace discovery is kept and improved.Changes
internal/namespacefs(~500 LOC of upload/list/delete/write machinery).upload_file,upload_files,list_files,delete_file,delete_namespace.list_namespacesto be graph-backed: distinct namespaces with per-namespace node counts, paginated, cross-namespace — so callers can discover and scope searches to other namespaces. Moved to the query tool group.internal/mcp/namespace_paths.go(still used by RAG doc reads), rewired ontopathutil.ValidateNamespacePath+safepath.EnsureNoSymlinkInPath. Validation logic unchanged.internal/pathutil;wikiserveruses it.AGENTS.md, and the integration script (drop the upload phases; the MCP build phase relied on upload and is covered by the webhook clone→build pipeline).Net −2235 lines. MCP tools 26 → 21 (this branch is off
main; independent of the pending analyzer/postprocess trim PRs).Design note (codebase-design)
namespacefswas a shallow 500-line module serving a single caller. Only its path-name validator had another user (wikiserver). Deleted the package; relocated the validator topathutil(correct locality for path/name safety), dropping no checks.Review
Independent adversarial review (path-traversal/symlink parity, DB-listing correctness, dangling refs): no P0/P1/P2. The relocated validator and resolver are byte-for-byte equivalent to the originals (same
ContainsAnyset, sameAbs→MkdirAll→EvalSymlinksroot resolution, same symlink guard). One P3 (empty-DBnullvs[]) fixed.Verification
go build+go vetclean;go test -tags fts5 ./...green;bash -non the integration script clean.tools/listreturns 21 tools; the 5 upload/delete tools absent;list_namespacespresent and DB-backed — with two seeded namespaces it returns[{alpha, node_count:2}, {beta, node_count:2}].🤖 Generated with Claude Code